package 单例;

/**
 * @Author Klys
 * @Date 2023/3/5 14:11
 * @Description
 * @Version 1.0
 */
//双重校验锁制
public class DCL {

    private volatile static DCL instance;

    private DCL() {

    }

    public static DCL getInstance() {
        if (instance == null) {
            synchronized (instance) {
                if (instance == null) {
                    instance = new DCL();
                }
            }
        }
        return instance;
    }
}
